
var EXPORTED_SYMBOLS = ["bbWindowUtils"];

const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;

var bbWindowUtils = {

  /**
   * \brief WindowFocus will focus a window of a specified type if available.
   * @param aWindowType type of window to focus.
   * @return the window that is now in focus.
   */

  focus: function(aWindowType) {
    var wm = Cc["@mozilla.org/appshell/window-mediator;1"]
               .getService(Ci.nsIWindowMediator);
    var win = wm.getMostRecentWindow(aWindowType);
    if (win)
      win.focus();
    return win;
  }
}
